<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>ContextManager.h</h1><a href="ContextManager_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         ContextManager.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        </span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     OGLES2</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Manages contexts so that extensions can be accessed. This is</span>
00014 <span class="comment">               intended to be a foundation for a more sophisticated manager in</span>
00015 <span class="comment">               the future. TODO: make work with multiple contexts</span>
00016 <span class="comment"></span>
00017 <span class="comment">******************************************************************************/</span>
00018 <span class="preprocessor">#ifndef _CONTEXTMANAGER_H_</span>
00019 <span class="preprocessor"></span><span class="preprocessor">#define _CONTEXTMANAGER_H_</span>
00020 <span class="preprocessor"></span>
00021 <span class="preprocessor">#include "PVRTools.h"</span>
00022 <span class="preprocessor">#include "PVRTSingleton.h"</span>
00023 <span class="preprocessor">#include "<a class="code" href="dynamicArray_8h.html">dynamicArray.h</a>"</span>
00024 
00025 <span class="keyword">namespace </span>pvrengine
00026 {
00027     <span class="comment">/*!***************************************************************************</span>
00028 <span class="comment">    * @Class ContextManager</span>
00029 <span class="comment">    * @Brief Manages contexts predominantly for extensions.</span>
00030 <span class="comment">    * @Description Manages contexts predominantly for extensions.</span>
00031 <span class="comment">    *****************************************************************************/</span>
00032     <span class="keyword">class </span>ContextManager
00033     {
00034     <span class="keyword">public</span>:
00035         <span class="comment">/*!***************************************************************************</span>
00036 <span class="comment">        @Function           ContextManager</span>
<a name="l00037"></a><a class="code" href="classpvrengine_1_1ContextManager.html">00037</a> <span class="comment">        @Description        Constructor.</span>
00038 <span class="comment">        *****************************************************************************/</span>
00039         <a class="code" href="classpvrengine_1_1ContextManager.html#a0">ContextManager</a>();
00040 
00041         <span class="comment">/*!***************************************************************************</span>
00042 <span class="comment">        @Function           ContextManager</span>
00043 <span class="comment">        @Description        Destructor.</span>
00044 <span class="comment">        *****************************************************************************/</span>
00045         <a class="code" href="classpvrengine_1_1ContextManager.html#a1">~ContextManager</a>(){}
00046 
00047         <span class="comment">/*!***************************************************************************</span>
00048 <span class="comment">        @Function           getExtensions</span>
00049 <span class="comment">        @Return             pointer to the extensions</span>
00050 <span class="comment">        @Description        Allows access to the OpenGL extensions class for the</span>
00051 <span class="comment">                            current context.</span>
<a name="l00052"></a><a class="code" href="classpvrengine_1_1ContextManager.html#a1">00052</a> <span class="comment">        *****************************************************************************/</span>
00053         CPVRTgles2Ext* <a class="code" href="classpvrengine_1_1ContextManager.html#a2">getExtensions</a>();
00054 
00055         <span class="comment">/*!***************************************************************************</span>
00056 <span class="comment">        @Function           getCurrentContext</span>
00057 <span class="comment">        @Return             pointer to the SPVRTContext</span>
00058 <span class="comment">        @Description        Allows access to the OpenGL ES2 SPVRTContext class for the</span>
00059 <span class="comment">                            current context.</span>
00060 <span class="comment">        *****************************************************************************/</span>
00061         SPVRTContext*   <a class="code" href="classpvrengine_1_1ContextManager.html#a3">getCurrentContext</a>();
00062 
00063         <span class="comment">/*!***************************************************************************</span>
00064 <span class="comment">        @Function           initContext</span>
00065 <span class="comment">        @Description        Initialises the current context.</span>
00066 <span class="comment">        *****************************************************************************/</span>
00067         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1ContextManager.html#a4">initContext</a>();
00068 
00069         <span class="comment">/*!***************************************************************************</span>
00070 <span class="comment">        @Function           addNewContext</span>
00071 <span class="comment">        @Return             handle of current context</span>
00072 <span class="comment">        @Description        adds a new context to the manager and returns its handle.</span>
00073 <span class="comment">        *****************************************************************************/</span>
00074         <span class="keywordtype">int</span> <a class="code" href="classpvrengine_1_1ContextManager.html#a5">addNewContext</a>(SPVRTContext *pContext);
00075 
00076         <span class="comment">/*!***************************************************************************</span>
00077 <span class="comment">        @Function           setCurrentContext</span>
00078 <span class="comment">        @Input              i32Context  context handle</span>
00079 <span class="comment">        @Description        sets the current context.</span>
00080 <span class="comment">        *****************************************************************************/</span>
00081         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1ContextManager.html#a6">setCurrentContext</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> i32Context);
00082     <span class="keyword">private</span>:
00083         <span class="comment">/****************************************************************************</span>
00084 <span class="comment">        ** Variables</span>
00085 <span class="comment">        ****************************************************************************/</span>
00087         <a class="code" href="classdynamicPointerArray.html">dynamicPointerArray&lt;SPVRTContext&gt;</a> m_daContext;
00089         <span class="keywordtype">int</span> m_i32CurrentContext;
00090     };
00091 }
00092 
00093 <span class="preprocessor">#endif // _CONTEXTMANAGER_H_</span>
00094 <span class="preprocessor"></span>
00095 <span class="comment">/*****************************************************************************</span>
00096 <span class="comment"> End of file (ContextManager.h)</span>
00097 <span class="comment">*****************************************************************************/</span>
00098 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
